package com.muse.appManage.controller;

import com.muse.appManage.service.ManageEyebrowShapeService;
import com.muse.entity.EyebrowShape;
import com.muse.entity.Result;
import com.muse.model.EyebrowShapeListParam;
import com.muse.model.ManageUserListParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: lee
 * Date: 2021/4/27
 * Time: 5:34 下午
 * Description:
 */
@RestController
@RequestMapping(value = "/manage/eyebrowShape")
@Slf4j
public class ManageEyebrowShapeController {

    @Autowired
    private ManageEyebrowShapeService eyebrowShapeService;

    @PostMapping("/create")
    public Result create(@RequestBody EyebrowShape eyebrowShape) {
        return eyebrowShapeService.create(eyebrowShape);
    }

    @PostMapping("/list")
    public Result<List<EyebrowShape>> list(@RequestBody EyebrowShapeListParam param,
                                           @RequestParam(name = "page", defaultValue = "1") Integer page,
                                           @RequestParam(name = "pageSize", defaultValue = "30") Integer pageSize) {
        return eyebrowShapeService.list(param, page, pageSize);
    }

    @GetMapping("/updateStatus/{id}/{status}")
    public Result updateStatus(@PathVariable Integer id,
                                @PathVariable Integer status) {
        return eyebrowShapeService.updateStatus(id, status);
    }

    @PostMapping("/update")
    public Result update(@RequestBody EyebrowShape param) {
        return eyebrowShapeService.update(param);

    }

}
